package Day05;

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        while(t-- > 0){
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            int tmp = Math.min(Math.min(a,b), c);
            long ans = (long)tmp * 2;
            if(b - tmp >= 2){
                ans += b - tmp + 1;
            }
            System.out.println(ans);
        }
    }

    class Pair{
        public int x;
        public int y;

        public Pair(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }


    public int rotApple (ArrayList<ArrayList<Integer>> grid) {
        Queue<Pair> queue = new LinkedList<>();
        int goodApple = 0;
        for(int i = 0; i < grid.size(); i++){
            for(int j = 0; j < grid.get(i).size(); j++){
                if(grid.get(i).get(j) == 1){
                    goodApple++;
                }else if(grid.get(i).get(j) == 1){
                    queue.add(new Pair(i, j));
                }
            }
        }
        int time = 0;
        while(!queue.isEmpty() && goodApple > 0){
            int sz = queue.size();
            for(int i = 0; i < sz; i++){
                Pair cur = queue.poll();
                if(check(cur.x - 1, cur.y, grid)){
                    queue.add(new Pair(cur.x - 1, cur.y));
                    goodApple--;
                }
                if(check(cur.x + 1, cur.y, grid)){
                    queue.add(new Pair(cur.x + 1, cur.y));
                    goodApple--;
                }
                if(check(cur.x, cur.y - 1, grid)){
                    queue.add(new Pair(cur.x, cur.y - 1));
                    goodApple--;
                }
                if(check(cur.x, cur.y + 1, grid)){
                    queue.add(new Pair(cur.x, cur.y + 1));
                    goodApple--;
                }
            }
            time++;
        }
        return time;
    }

    private boolean check(int x, int y, ArrayList<ArrayList<Integer>> grid) {
        if(x >= 0 && x < grid.size()
        && y >= 0 && y < grid.get(x).size()
        && grid.get(x).get(y) == 1){
            grid.get(x).set(y, 2);
            return true;
        }
        return false;
    }

    public int LastRemaining_Solution (int n, int m) {
        int[] dp = new int[n + 1];
        dp[1] = 0;
        for(int i = 2; i < n + 1; i++){
            dp[i] = (dp[i-1] + m) % i;
        }
        return dp[n];
    }
}
